// ============================== 导入依赖 ============================== //

import CONST from './CONST'

// ============================== 导出异步调用 ============================== //

export default {
  // —————————————————————————————— 列表 —————————————————————————————— //

  async remoteList({ state: { API, MAP, param }, rootState }) {
    const { id: assetId, assetTypeId } = rootState.one
    if (!assetId) return [1, CONST.EMPTY]

    const TIP = API.transTip(MAP.tipList, rootState.API)
    const [num, arr] = await API.getList({ ...param, assetTypeId: [assetTypeId] }, TIP)

    return num ? [num, arr] : [1, CONST.EMPTY]
  },
}
